package nl.fonfolio.view.project {
	import flash.display.*;
	import flash.text.TextField;

	import nl.fonfolio.model.Model;
	import nl.fonfolio.controller.Controller;

	import nl.fonfolio.core.FonfolioEvent;	
	import nl.fonfolio.core.Fonfolio;	
	
	/**
	 * @author Niels
	 */
	public class ProjectMovie extends Sprite {
		private var model:Model;
		private var controller:Controller;
		
		public var fonfolio:Sprite;
		
		public var project_lbl:TextField;
		public var project_txt:TextField;

		public function ProjectMovie(fonfolio:Fonfolio,model:Model,controller:Controller) {
		this.fonfolio = fonfolio;
			this.model = model;
			this.controller = controller;
			
			this.model.addEventListener(FonfolioEvent.CONTROL_TYPE, this.update);
		}

		private function update(event : FonfolioEvent) : void {
			trace(event.command);
			switch (event.command){
				case "LOAD_PROJECT":
					var currentProject:Object = this.model.getProject();
					for (var i : Number = 0;i <= currentProject.length - 1;i++) {
						trace(currentProject[i].projectId);
						//project_lbl.text = "label";
						//project_txt.text = "bla";
					}
				break;
			}
		}
	}
}
